package com.googlecode.ddplan;

import java.util.HashSet;
import java.util.Set;

public class ValidationResult {
	private Set<String> validationErrors;

	public ValidationResult() {
		validationErrors = new HashSet<String>();
	}
	
	public ValidationResult(String error) {
		this();
		validationErrors.add(error);
	}

	public boolean isValid() {
		return validationErrors.isEmpty();
	}

	public void addError(String error) {
		validationErrors.add(error);
	}

	public void aggregate(ValidationResult otherValidation) {
		validationErrors.addAll(otherValidation.validationErrors);
	}

	public Set<String> getErrors() {
		return validationErrors;
	}
}
